#ifndef C_PARSER_H
#define C_PARSER_H

/**
 * This simple parser is the replacement for the xml-parser.
 * Format:
 * name [attrib value] [...]
 */

#include <stdlib.h>
#include <string.h>

typedef void (*on_begin)(void*, char *, char **);

typedef struct parseable_t {
	char *to_parse;
	int size;
} parseable;

typedef struct parser_t {
	void *userdata;
	on_begin callback;
	parseable *p;
} parser;

int parse(parser *pars);
parser* parser_create();
void parser_delete(parser *p);

void parse_add(parser *p, char c);

#endif
